﻿using System;
using System.Windows.Data;
using System.Windows.Controls;

namespace Dsl.Ped.Common.Converters
{
    /// <summary>
    /// Converts <see cref="Orientation"/> into a <see cref="Dock"/>
    /// </summary>
    public class OrientationToDockConverter : IValueConverter {

        #region Implementation of IValueConverter

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
            var orientation = (Orientation)value;
            return orientation == Orientation.Horizontal ? Dock.Left : Dock.Top;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
            throw new NotImplementedException();
        }

        #endregion
    }
}
